//
// Created by lenovo on 2024/1/11.
//

#ifndef CALCULATOR_OPERATOR_H
#define CALCULATOR_OPERATOR_H

#include "Evaluable.h"
#include <string>
#include <utility>
class Operator : public Evaluable{
    //二叉树的结构的语法树
    //由运算符、左值、右值构成
public:
    std::string OptType ;
    Evaluable* pre {nullptr};
    Evaluable* post {nullptr};
public:
    Operator() = default ;

    explicit Operator(std::string opt) : OptType(std::move(opt)) {}

    Operator(std::string opt, Evaluable* pre_eval, Evaluable* post_eval) {
        OptType = std::move(opt) ;
        pre = pre_eval ;
        post = post_eval ;
    }

    double getValue() override ;
};



#endif //CALCULATOR_OPERATOR_H
